// 字典类型
const DictType = {
    Platform: 1,
    Spider: 2,
    JsModule: 3,
    Options: () => {
        return JSON.parse(JSON.stringify([{
            key: DictType.Platform,
            name: "平台类型"
        }, {
            key: DictType.Spider,
            name: "爬虫平台"
        }, {
            key: DictType.JsModule,
            name: "模块名称"
        }]))
    }
}
// 目标类型
const SourceType = {
    Detail: 0,//详情
    Batch: 1, //列表
    Radios: () => {
        return JSON.parse(JSON.stringify([{
            id: SourceType.Batch,
            name: "列表",
        }, {
            id: SourceType.Detail,
            name: "详情"
        }]))
    }
}

// 作用范围
const UsageScope = {
    Spider: 1,      //爬虫
    Ai: 2,          //AI生成
    Publisher: 3,   //发布
    Options: () => {
        return JSON.parse(JSON.stringify([{
            id: UsageScope.Spider,
            name: "采集",
        }, {
            id: UsageScope.Ai,
            name: "生成"
        }, {
            id: UsageScope.Publisher,
            name: "发布"
        }]))
    }
}

const ArticleStatus = {
    Initial: 0, //初始化
    Gather: 1, // 已采集
    Aigced: 2, //已生成
    Published: 3, //已发布
    Options: () => {
        return JSON.parse(JSON.stringify([
            {
                id: ArticleStatus.Initial,
                name: "待采集",
            },
            {
                id: ArticleStatus.Gather,
                name: "已采集",
            },
            {
                id: ArticleStatus.Aigced,
                name: "已生成",
            },
            {
                id: ArticleStatus.Published,
                name: "已发布",
            },
        ]))
    }
}

const CronType = {
    Instant: 1,
    Specific: 2,
    Timing: 3,
    Options: () => {
        return JSON.parse(JSON.stringify([{
            id: CronType.Instant,
            name: "立即执行",
        }, {
            id: CronType.Specific,
            name: "指定时间执行",
        }, {
            id: CronType.Timing,
            name: "定时执行",
        }]))
    },
}

const CronStatus = {
    Waiting: 0,
    Executing: 1,
    Success: 2,
    Failure: 3,
    Timeout: 4,
    Options: () => {
        return JSON.parse(JSON.stringify([{
            id: CronStatus.Waiting,
            name: "待执行"
        }, {
            id: CronStatus.Executing,
            name: "执行中"
        }, {
            id: CronStatus.Success,
            name: "已完成"
        }, {
            id: CronStatus.Failure,
            name: "已失败"
        }, {
            id: CronStatus.Timeout,
            name: "已过期"
        }]))
    }
}

const EnableStatus = {
    enable: 1,
    disable: 0,
}

const Lang = {
    cn: 1,
    en: 2,
    vn: 3,
    sp: 4,
    rs: 5,
    ar: 6,
    jp: 7,
    ge: 8,
    pt: 9,
    id: 10,
    Options: () => {
        return JSON.parse(JSON.stringify([{
            id: Lang.cn,
            name: "汉语"
        }, {
            id: Lang.en,
            name: "英语"
        }, {
            id: Lang.vn,
            name: "越南语"
        }, {
            id: Lang.sp,
            name: "西班牙语"
        }, {
            id: Lang.rs,
            name: "俄罗斯语"
        }, {
            id: Lang.ar,
            name: "阿拉伯语"
        }, {
            id: Lang.jp,
            name: "日语"
        }, {
            id: Lang.ge,
            name: "德语"
        }, {
            id: Lang.pt,
            name: "葡萄牙"
        }, {
            id: Lang.id,
            name: "印地语"
        }]))
    }
}

export {
    Lang,
    CronType,
    DictType,
    CronStatus,
    SourceType,
    UsageScope,
    ArticleStatus,
}